<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>

<div class="container breadcrumbs">
    <?php
    $classMenu = $this->shopHelper()->helperPartial('goodsListHelper', 1, $this->classInfo);
    echo $this->partial($classMenu['partialFile'], $classMenu['partialArg']);
    ?>
    <span><?php echo $this->escapeHtml($this->classInfo->getClassName()); ?></span>
</div>

<?php if (!empty($this->goodsListPartial[1]['partialArg']['adImage'])) { ?>
    <div class="container">
        <div style="padding-bottom: 10px;">
            <?php echo $this->partial($this->goodsListPartial[1]['partialFile'], $this->goodsListPartial[1]['partialArg']); ?>
        </div>
    </div>
<?php } ?>

<div class="container">
    <div class="row">
        <div class="col col-4">
            <div class="goodslist-left-sidebar">
                <div class="left-title"><?php echo $this->translate('当前分类'); ?></div>
                <div class="left-sidebar-content">
                    <ul class="list-unstyled goodsclass-list">
                        <?php foreach ($this->currentClass as $currentClassVal) { ?>
                            <li <?php if($currentClassVal->getClassId() == $this->classInfo->getClassId()) echo 'class="active"'; ?>><span></span><a href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $currentClassVal->getClassId()]); ?>"><?php echo $this->escapeHtml($currentClassVal->getClassName()); ?></a>
                                <?php if($currentClassVal->getClassId() == $this->classInfo->getClassId() && $this->subClass) { ?>
                                    <ul class="list-unstyled">
                                        <?php foreach($this->subClass as $subClassVal) { ?>
                                            <li class=""><span></span><a href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $subClassVal->getClassId()]); ?>"><?php echo $this->escapeHtml($subClassVal->getClassName()); ?></a></li>
                                        <?php } ?>
                                    </ul>
                                <?php } ?>
                            </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>

            <?php if (!empty($this->goodsListPartial[2]['partialArg']['adImage'])) { ?>
                <div class="goodslist-left-ad">
                    <?php echo $this->partial($this->goodsListPartial[2]['partialFile'], $this->goodsListPartial[2]['partialArg']); ?>
                </div>
            <?php } ?>

        </div>

        <div class="col col-16">
            <div class="goodslist-right">
                <div class="xm-line-box filter-box">
                    <div class="box-hd">
                        <h3 class="title"><?php echo $this->escapeHtml($this->classInfo->getClassName()); ?></h3>
                    </div>
                    <div class="box-bd">
                        <div class="filter-lists">
                            <?php if($this->classBrand) { ?>
                            <dl class="xm-filter-list  category-filter-list clearfix">
                                <dt><?php echo $this->translate('品牌'); ?>：</dt>
                                <dd>
                                    <ul class="clearfix" id="typeAdapt">
                                        <li class="first <?php if ($this->searchArray['brandId'] == 0) echo 'current'; ?>"><a href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_replace($this->searchArray, ['brandId' => 0])]); ?>"><?php echo $this->translate('全部'); ?></a></li>
                                        <?php foreach ($this->classBrand as $classBrandValue) { ?>
                                            <li <?php if($this->searchArray['brandId'] == $classBrandValue[0]->getBrandId()) echo 'class="current"'; ?>><a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => $this->searchArray ? array_merge($this->searchArray, ['brandId' => $classBrandValue[0]->getBrandId()]) : ['brandId' => $classBrandValue[0]->getBrandId()]]); ?>"><?php echo $this->escapeHtml($classBrandValue['brandName']); ?></a></li>
                                        <?php } ?>
                                    </ul>
                                </dd>
                            </dl>
                            <?php } ?>

                            <?php if($this->classTagGroup) foreach ($this->classTagGroup as $tagGroupValue) { ?>
                                <dl class="xm-filter-list  category-filter-list clearfix">
                                    <dt><?php echo $this->escapeHtml($tagGroupValue->getTagGroupName()); ?>：</dt>
                                    <dd>
                                        <ul class="clearfix" id="typeAdapt">
                                            <li class="first <?php if (!isset($this->searchArray['tag'][$tagGroupValue->getTagGroupId()])) echo 'current'; ?>"><a href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_merge($this->searchArray, ['tagGroupId' => $tagGroupValue->getTagGroupId()])]); ?>"><?php echo $this->translate('全部'); ?></a></li>
                                            <?php if(isset($this->classTag[$tagGroupValue->getTagGroupId()])) foreach ($this->classTag[$tagGroupValue->getTagGroupId()] as $classTagValue) {
                                                $queryArray = $this->searchArray;
                                                $queryArray['tag'][$tagGroupValue->getTagGroupId()] = $classTagValue->getTagId();
                                                ?>
                                                <li <?php if(isset($this->searchArray['tag'][$tagGroupValue->getTagGroupId()]) && $this->searchArray['tag'][$tagGroupValue->getTagGroupId()] == $classTagValue->getTagId()) echo 'class="current"'; ?>><a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => $queryArray]); ?>"><?php echo $this->escapeHtml($classTagValue->getTagName()); ?></a></li>
                                            <?php } ?>
                                        </ul>
                                    </dd>
                                </dl>
                            <?php } ?>

                        </div>
                    </div>
                </div>

                <div class="xm-line-box goods-list-box">
                    <div class="box-hd">
                        <div class="filter-lists">
                            <dl class="xm-filter-list xm-filter-list-first category-filter-list clearfix">
                                <dd>
                                    <ul class="clearfix" id="typeOrder">
                                        <li <?php if(!isset($this->searchArray['sort'])) echo 'class="current first"'; ?>>
                                            <a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_replace($this->searchArray, ['sort' => ''])]); ?>"><?php echo $this->translate('最新'); ?></a>
                                        </li>
                                        <li <?php if(isset($this->searchArray['sort']) && in_array($this->searchArray['sort'], ['priceDESC'])) echo 'class="current"'; ?>>
                                            <a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_merge($this->searchArray, ['sort' => 'priceDESC'])]); ?>"><?php echo $this->translate('价格从高到低'); ?></a>
                                        </li>
                                        <li <?php if(isset($this->searchArray['sort']) && in_array($this->searchArray['sort'], ['priceASC'])) echo 'class="current"'; ?>>
                                            <a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_merge($this->searchArray, ['sort' => 'priceASC'])]); ?>"><?php echo $this->translate('价格从低到高'); ?></a>
                                        </li>
                                        <li <?php if(isset($this->searchArray['sort']) && in_array($this->searchArray['sort'], ['clickDESC'])) echo 'class="current"'; ?>>
                                            <a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_merge($this->searchArray, ['sort' => 'clickDESC'])]); ?>"><?php echo $this->translate('人气从高到低'); ?></a>
                                        </li>
                                        <li <?php if(isset($this->searchArray['sort']) && in_array($this->searchArray['sort'], ['clickASC'])) echo 'class="current"'; ?>>
                                            <a rel="nofollow" href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $this->classInfo->getClassId()], ['query' => array_merge($this->searchArray, ['sort' => 'clickASC'])]); ?>"><?php echo $this->translate('人气从低到高'); ?></a>
                                        </li>
                                    </ul>
                                </dd>
                            </dl>
                        </div>
                        <div class="more">
                            <div class="filter-stock">
                                <?php echo $this->translate('共'); ?> <span style="color: #ED154B;"><?php echo $this->goodsList->getTotalItemCount(); ?><?php echo $this->translate('个'); ?></span> <?php echo $this->translate('商品'); ?>
                            </div>
                        </div>
                    </div>

                    <div class="box-bd">
                        <div class="goods-list-section">
                            <div class="xm-goods-list-wrap xm-goods-list-wrap-col20" style="padding-bottom: 60px;">
                                <ul class="xm-goods-list clearfix">
                                    <?php
                                    if ($this->goodsList->getCurrentItemCount() > 0) { foreach ($this->goodsList as $goodsValue) {
                                        $goodsName = $this->escapeHtml($goodsValue[0]->getGoodsName());
                                        ?>
                                        <li class="">
                                            <div class="xm-goods-item">
                                                <div class="item-thumb"> <a href="<?php echo $this->url('shop-goods', ['id' => $goodsValue[0]->getGoodsId()], ['query' => ['classId' => $this->classInfo->getClassId()]]); ?>" title="<?php echo $goodsName; ?>" target="_blank"> <img alt="<?php echo $goodsName; ?>" src="" data-original="<?php echo $this->shopHelper()->baseGoodsImagePath($goodsValue['goodsThumbnailImage']); ?>" class="lazy"></a></div>
                                                <div class="item-info">
                                                    <div class="item-price"> <span><?php echo (isset($goodsValue['goodsGroupPrice']) && $goodsValue['goodsGroupPrice'] > 0) ? $this->frontCurrency($goodsValue['goodsGroupPrice']) : $this->frontCurrency($goodsValue[0]->getGoodsPrice()); ?></span><?php if($goodsValue[0]->getGoodsMarketPrice() > 0) { ?><span class="sep">|</span><del><?php echo $this->frontCurrency($goodsValue[0]->getGoodsMarketPrice()); ?></del> <?php } ?></div>
                                                    <h3 class="item-title"> <a href="<?php echo $this->url('shop-goods', ['id' => $goodsValue[0]->getGoodsId()], ['query' => ['classId' => $this->classInfo->getClassId()]]); ?>" title="<?php echo $goodsName; ?>" target="_blank"><?php echo $goodsName; ?></a></h3>
                                                    <div class="item-star"><?php echo $this->escapeHtml($goodsValue[0]->getGoodsExtendName()); ?></div>
                                                    <div class="item-actions item_goods_<?php echo $goodsValue[0]->getGoodsId(); ?>">
                                                        <a onclick="addCart(<?php echo $goodsValue[0]->getGoodsId(); ?>);" href="javascript: void(0);" class="btn btn-small btn-primary J_addCart"><i class="iconfont"></i><?php echo $this->translate('购物车'); ?></a>
                                                        <a onclick="addFav(<?php echo $goodsValue[0]->getGoodsId(); ?>);" href="javascript: void(0);" class="btn btn-dake btn-small J_addFav"><i class="iconfont"></i><?php echo $this->translate('收藏'); ?></a>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                    <?php } } ?>
                                </ul>
                            </div>
                            <?php echo $this->paginationControl($this->goodsList, 'Sliding', 'shop/page', ['route' => 'shop-class', 'params' => ['action' => 'goodsList', 'id' => $this->classInfo->getClassId()]]); ?>
                        </div>
                    </div>

                </div>

            </div>
        </div>

    </div>
</div>

<?php if (!empty($this->goodsListPartial[3]['partialArg']['adImage'])) { ?>
    <div class="container">
        <div>
            <?php echo $this->partial($this->goodsListPartial[3]['partialFile'], $this->goodsListPartial[3]['partialArg']); ?>
        </div>
    </div>
<?php } ?>